import requests


header = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
                  'Chrome/135.0.0.0 Safari/537.36 Edg/135.0.0.0',
}

req = requests.get("https://bj.ke.com/api/newhouserecommend?type=1&query=https%3A%2F%2Fbj.ke.com%2Fershoufang%2F", headers=header)
fangzi = req.json()['data']

for item in fangzi:
    print(item)